package lab02.Test11;

/**
 * Created by lenovo on 2017/10/20.
 */
public class Square extends Rectangle {
    public Square(double l,double w){
        super(l,w);

    }
    double dia(){

        double dui=Math.sqrt(length*length*2);
        return dui;
    }
    @Override
    public void printMyWay(){

        System.out.println("正方形边长："+length);
        System.out.println("正方形面积："+area());
        System.out.println("正方形周长："+periemer());
        System.out.println("正方形对角线长："+dia());
    }
}
